<?php
session_start();
require_once '../dao/membersdao.php';
require_once '../dto/memberdto.php';
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
    $username = $_SESSION["Name"];
    $email= $_REQUEST["tbemail_edit"];
    $pass = $_REQUEST["tbpassword_edit"];
    $location = $_REQUEST['tblocation_edit'];
    $age = $_REQUEST['tbage_edit'];
    $status = $_REQUEST['tbstatus_edit'];
    $gender = $_REQUEST['tbgender_edit'];
    if($gender)
        $gender=TRUE;
    else {
        $gender=FALSE;
    }
    $member = new memberdto();
    //$member->_construct($username, $pass, $email);
    $member->_contruct($username, $pass, $email, $age, $location, $gender, $status);
//    $member->setLocation($location);
//    $member->setAge($age);
//    $member->setStatus($status);
    $editresult = membersdao::UpdateMember($member);
    if($editresult){
         $_SESSION["member"]=$member;
        header("location:../page/home.php");
    }
    else {
        header("location:../page/errorpage.php");
    }
?>